Microprocessor motor control

ABSTRACT

A method for providing motion information for a motor controller is accomplished by defining a determined set of motion parameters for describing a desired motion in terms of encoder position data. The parameters are stored for use in calculating the desired motion profile of the motor during the various motion segments of the desired profile as the motor is being driven. The method saves on required memory storage for all the various motor profiles typically used in devices such as inserters since only the parameters used in calculating must be stored. A flag field is also provided to enable the microprocessor to determine which of the segments is being generated.

FIELD OF THE INVENTION

The invention relates to systems control apparatus and more particularlyto a method for describing motion for use with microprocessor-controlledmotors.

BACKGROUND OF THE INVENTION

Many methods for microprocessor control of motors and more particularlyfor motors for use with insertion devices have been developed. Whilemany of these methods can work quite well, these known solutions requirelarge amounts of both read-only-memory (ROM) space andrandom-access-memory (RAM) space in order to load the resulting motorprofiles.

U.S. Pat. No. 3,709,482 to Nelson, et. al. describes a high speeddocument feeder using synchronous operation. U.S. Pat. No. 3,825,251discloses a system for controlling the feed of documents into and alonga document path.

U.S. Pat. No. 5,003,485 describes an asynchronous communication protocolfor a collating and insertion device. U.S. Pat. No. 5,02,073 describes acard and mailer data inserter system. None of the foregoing teach amethod for describing required motor profiles in an economical way forsaving space in the memories of the microprocessor controller.

SUMMARY OF THE INVENTION

It is therefore an object of the invention to provide an improved methodfor storing motor profiles with an economical use of limited memory.

It is a further object of the invention to provide a method forgenerally describing motion which is useful for event-driven control ofthe motors of an insertion device.

The above and other objects are attained in a method for providingmotion information for a motor controller for a motor having an encoderfor providing motor feedback data, the method comprising the steps ofdefining a determined set of motion parameters for describing a desiredmotion in terms of encoder position data, storing the parametersgenerated in accordance with the defining process, calculating motordrive information using the parameters and the encoder data for controlof said motor during operation of the motor, and driving said motor inaccordance with the calculated information.

The method saves on required memory storage for all the various motorprofiles typically used in devices such as inserters since only theparameters used in calculating must be stored. A flag field is alsoprovided to enable the microprocessor to determine which of the segmentsis being generated.

BRIEF DESCRIPTION OF THE DRAWING

FIG. 1 is a side elevational schematic view of an envelope insertingapparatus in which an asynchronous control system in accordance with theinvention may be utilized;

FIG. 2 is a perspective view of the inserting apparatus of FIG. 1showing an envelope at the inserting station.

FIG. 3 is a schematic side elevation view of the inserting apparatus ofFIG. 1 showing details of the sucker bar assembly and with an envelopeat the arming station.

FIG. 4 is a schematic side elevation view of the apparatus of FIG. 1which includes the output belt assembly.

FIG. 5 is a schematic of the skew sensor array.

FIG. 6 illustrates the various inputs and outputs of the arming stationsoftware control module for beginning the process of preparing anenvelope for receiving the collation.

FIG. 7 is a flow chart of the operation of module of FIG. 6.

FIG. 8 illustrates the main drum software program module.

FIG. 9 is an illustrative flow chart of the operation of the module ofFIG. 8.

FIG. 10 illustrates the input and output of the skew detector module.

FIG. 11 is a flow chart of the operation of the skew detector module.

FIG. 12 illustrates the backstop software program module.

FIG. 13 is a flow chart of the operation of the module of FIG. 12.

FIG. 14 shows the pusher module which controls the operation of thepusher assembly.

FIG. 15 is a flow chart of the operation of the module of FIG. 14.

FIG. 16 shows the enclosure belt program module.

FIG. 17 illustrates the sucker bar software program module.

FIG. 18 is a flow chart of the operation of sucker bar program module.

FIG. 19 shows the insert timing belt module which controls the insertbelt drive.

FIGS. 20 and 21 show the modules for control of the right and lefthorns, respectively.

FIGS. 22 and 23 are the respective flow charts for the modules of FIGS.21 and 22 for controlling the operation of the right and left horns.

FIG. 24 illustrates the exit roller software module.

FIG. 25 illustrates the inputs and outputs of the divert module.

FIG. 26a and 26b comprise a timing diagram of the operating sequence ofthe various motors controlled by the software modules.

FIG. 27 is a typical motion profile for an operation.

FIG. 28 shows the profile of FIG. 27 broken into segments forillustrating the various calculations in accordance with the invention.

FIGS. 29a and 29b illustrate flow charts of the calculation inaccordance with the invention.

FIG. 30 shows a memory allocation in accordance with the invention.

FIG. 31 shows a variation of a profile in which a determined motionproceeds until a command is received to change the segment.

DESCRIPTION OF THE PREFERRED EMBODIMENT

In FIGS. 1 through 4 there is shown generally at 10 an inserter devicein which a motion profile calculation in accordance with the inventionmay be incorporated. In the apparatus illustrated, the inserting station10 includes an envelope arming or staging area shown at 20 whichcomprises angled guide plates 24 and a series of laterally spaced rollerpairs 23 and 23 for receiving individual envelopes from a conventionaltransport system (not shown). Conveniently, roller 23 is driven by aservo motor via a conventional timing pulley and belt (also not shown).

The envelope inserting station further comprises a vacuum drum 30, whichsupplies a valved vacuum at its periphery by way of holes (not shown)straddled by a plurality of laterally spaced transport belts 60 whichmove about the periphery of the drum as well as pulleys 62, 63, and 64(FIGS. 3 and 4).

Vacuum deck 40 has a horizontal surface adjacent to the top of thevacuum drum 30 which has grooves for guiding the transport belts 60 andapertures (not shown) respectively located between each pair oftransport belts 60 through which members of backstop 50 may protrude.

Backstop 50 comprises a plurality of laterally-spaced "two-around"fingers 52 that when protruding above the surface will create a wall forstopping an incoming envelope. The fingers are fixed to a single axle 54driven by a servo motor (not shown).

The vacuum or sucker bar assembly 70 includes a support bar 72 (FIG. 2)which spans the width of the vacuum deck and is rigidly secured at theends to pivotable arms 73 which rotate concentrically about a pivotpoint 71. At various locations along the bar are clamped tubes 74 benttoward the deck and having a vacuum suction cup 78 at the end. As thebar assembly pivots, the vacuum cups move toward the deck 40 to wherethey can contact the back panel 7 of the envelope 6. In this position,the vacuum is valved "on" so that with the front panel held in place,the envelope opens as the vacuum cups 78 are rotated in the oppositedirection.

As seen in FIGS. 3 and 4, link 82 attached to arm 73 extends back to amotor/crank assembly indicated at 80. Eccentric crank 84 is controlledby a servo motor (not shown) that drives the link 82. As the eccentriccrank rotates, link 82 is driven back and forth to cause the vacuum barassembly to rock forward and then backward to open the envelope.

Dual belt transport 90 comprises two pairs of continuously moving,preferably elastic, transport belts 92 and 93 that accept and transportcollations such as the one shown at 9 being conveyed from an upstreamstation (not shown). Overhead pusher assembly 100 comprises a pluralityof laterally spaced belts 102, each belt having pusher fingers 104located approximately 180 degrees apart around the periphery. Thesepusher fingers 104 are aligned to create a wall which pushes thecollation 9 into the waiting envelope. In FIG. 2 the overhead pusherassembly 100 is shown pivoted into an open position for accessibility tothe paper path.

As shown in FIG. 4, output belt assembly 110 extends from verticallyabove the insertion area to the most downstream portion of the insertiondevice 10. The output belt assembly 110 includes continuously runningupper belts 112 which both interfere with the fingers 52 of the backstop50 and mesh with the transport belts 60. Fingers 52 include a groovethrough which the lower reach of corresponding belts travel when thefingers 52 are in an upright position. As shown in FIG. 2, theinterference by belts 112 with fingers 52 are obscured by belt supportmember 113. The interference of belts 112 and fingers 52 form a capturearea from which the envelope cannot escape as it is driven to backstop50. The meshing of upper belts 112 with the transport belts 60 providesa positively controlled output transport for filled envelopes as theyexit the insertion area.

Returning to FIG. 1, a pair of funnel shaped guide fingers or horns 120are supported from above the envelope path and are eccentrically mountedon shafts 122 so that they can be pivoted into a waiting envelope 6 toshape and support the edges of the envelope for ease of entry of thecollation. Once the vacuum bar assembly 70 has begun the process ofopening the envelope, the guide horns are pivoted into the open envelopeand continue the pivoting motion until the edges of the envelope areshaped and supported by the horn profile. It will be understood that theguide horns 120 also serve to center the envelope 6 in the path of theoncoming collation 9. A more detailed description of the guide horns maybe obtained from application Ser. No. 08/037842, now U.S. Pat. No.5,247,780, specifically incorporated herein by reference.

The flap 3 of the envelope is maintained in the flapped condition byflap retainers 25 which in conjunction with the guide horns 120 andvacuum deck 40 maintain the lower envelope panel 8 and flap 3 inposition to receive the collation.

Sensors for the detection of the position of the envelope and thecollation are disposed in the system at suitable points as will bediscussed below. FIG. 5 shows one particular set of sensors S15 at 312,S16 at 314 and S17 at 316 which are arranged in conjunction withalignment sensors shown at 318 all generally shown on the deck 40 (FIGS.3 and 4) to detect the passage and alignment of the envelope as itpasses.

For use in conjunction with the invention herein described, closed-loopservo motors, commonly referred to as smart motors, such as the SigmaxII stepping motors manufactured by Pacific Scientific Motor and ControlDivision of Rockford, Ill., are used to drive the driven components ofthe the inserting station 10.

For further details of the operation of the illustrated insertionstation, reference may be made to application Ser. No. 08/144,466, nowU.S. Pat. No. 5,447,015, (Atty. Docket. E-117) assigned to the assigneeof the instant application and specifically incorporated by referenceherein. A suitable microcomputer and communication scheme for use withinserter devices is described in U.S. Pat. No. 5,003,485 to Franciscowhich is also specifically incorporated by reference herein.

Generally, the overall operation of the insertion device operating undercontrol of the system control in accordance with the present inventionis as follows. The rollers 22 and 23 of the envelope arming station 20are stopped with an envelope (for purposes of this description envelope#1) in a known position. When a feed command is received, the armingstation 20 waits for a predetermined period of time before feeding theenvelope. This creates a specific gap between envelopes in the insertionarea. When the desired gap is attained, the envelope #1 is fed to theconstantly running transport belts 60. At the same time, anotherenvelope (#2) can be fed to the known position at the arming station 20and will remain there until the next feed command.

As the envelope #1 travels along the constantly running transport belts,the vacuum at vacuum drum 30 is actuated based on the envelope position.The vacuum provides positive drive for the envelope on the curved path.The vacuum can be turned off when the envelope travels past the drum. Itwill be appreciated that this travel distance is equal to the envelopedepth.

As envelope #1 continues its travel on the continuously runningtransport belts 60, its lead edge crosses the sensor array 312 to 318 onthe vacuum deck 40. The sensor crossing in conjunction with the userinput for envelope depth triggers actuation of the sucker bar assembly70. When the sucker bar assembly 70 has opened the envelope to apredetermined amount, the horns 120 rotate into the open envelope andupon completion of the rotation into the envelope, the envelope isprepared for insertion and will wait in this position for a collation toarrive. It will be appreciated that in one of the significant advantagesof this asynchronous system in accordance with the invention, theenvelope can wait in this position for an unlimited period of time oruntil a specified time-out condition is reached as desired.

As the collation enters the the insertion area, its trailing edgecrosses a sensor which triggers the start of the motion of the overheadpusher 100. The pushers 104 meet the trailing edge of the collation andpush it into the prepared envelope. The sucker bar assembly 70 releasesthe envelope in accordance with a specific predetermined pusher positionand returns to its home position. At a different predetermined pusherposition, the backstop 50 rotates away from the leading edge of theenvelope to allow the stuffed envelope to exit. As the backstop 50begins its rotation, a feed command is issued to the arming station 20to feed envelope #2. It will be understood that the sequence continuesfor additional envelopes until a stop command is issued.

The backstop remains clear of the output path until the leading edge ofthe exiting envelope crosses a last sensor. The sensor crossing inconjunction with the envelope depth and the flap length triggers thereturn of the backdrop to its vertical position. The horns also returnto the the recessed position where they are ready to pivot into the nextenvelope.

In accordance with the invention, each of the operations described aboveare computer-controlled by various software modules that will now bedescribed.

FIG. 6 illustrates the various inputs and outputs of the arming stationsoftware control module 200 for beginning the process of preparing anenvelope for receiving the collation. The arming station softwareprogram module indicated at 200 accesses user data such as envelopedepth and the like input by the user as indicated at 202. In this andthe following figures, solid lines indicate data flow while dashed lineswill indicate control information.

As seen in FIG. 6, additional information and sensor data is receivedfrom the insert timing belt at 204 from which the envelope position isderived. Sensor S19 at 206 shows the presence or absence of the envelopein the arming station. When an envelope feed request is received, 208, amotor profile is selected to command the motor M9, 210, in accordancewith the selected profile typically after a delay as previously broughtout to create the proper gap. Motor position information is provided byencoder E9, 212, in conventional manner. On receipt of a signal fromsensor 206 that the envelope has cleared, a deceleration motor profileis selected and the module then waits for the backstop trigger at 214 toarm the next envelope. The operating states of this module at the armingstation are Not Armed, Armed, or Run, and for the sensor 206 Open (noenvelope) or Closed (envelope). FIG. 7 is a flow chart of the operationof module 200.

As shown in FIG. 8, the main drum software program module 300 alsoreceives the user information from the user 202 along with the positioninformation from the insert timing belt at 204 as well as the detectionof a first crossing by the skew detector module 302. The vacuum valveposition may be controlled via software commands to motor M8, at 304,based on information from sensors S18, 306, and S18, at 308, forcontrolling a vacuum source generated by operation of motor M15 (310)with position information supplied by encoder E8 at 311. Alternatively,the valve may simply be controlled by mechanical linkages incorrespondence with the position of the drum itself. A valve homeposition signal is provided at 312. The motor 310 preferably runsconstantly while the sensors signal the state of the vacuum valve andthe presence or absence of pressure. FIG. 9 is an illustrative flowchart of the operation of the module of FIG. 8.

FIG. 10 illustrates the input and output of the skew detector module302. User information and particularly the envelope width is supplied byuser 202 which along with the sensing of the envelope at sensors S15 at312, S16 at 314, and S17 at 316 are used to signal the first crossing tothe main drum module 300 and provide a trigger signal to the sucker barassembly 70 and horns 120 if the amount of skew is determined to bewithin an acceptable range. FIG. 11 is a flow chart of the operation ofthe module 302. Envelope location and alignment operation is alsodetermined by the information from the alignment sensor array at 318.

FIG. 12 illustrates that the backstop software program module 214receives information from the user 202 as well as pusher positioninformation from pusher module 400 and provides commands in accordancewith a selected profile to the backstop motor M6, shown at 350, withfeedback information provided by encoder E6 at 352 for operation of thebackstop 50. Reset sensor S12 at 354 and Home sensor S13 at 356 detectthe presence or absence of the envelope at the backstop. As the backstopbegins to rotate away, a backstop trigger signal is provided to theArming station module 200 and to the Main drum module 300 for feedingthe next envelope. FIG. 13 is a flow chart of the operation of themodule of FIG. 12.

FIG. 14 shows pusher module 400 which controls the operation of pusherassembly 100. The module 400 receives user information from the user 202as well as enclosure (collation) position information from enclosurebelt module 450. Pusher motor M2 at 402 which drives the pusher assembly100 receives motor commands based on predetermined motor profilesselected at module 400 while the motor position is provided by encoderE2 at 404. Pusher assembly position information is provided to thebackstop module 214, sucker module 500, left horn module 550 and righthorn module 600. Home sensor S9 at 406 detects the home position of theassembly while trigger sensor S3 at 408 is used to determine thepresence of an enclosure or collation package. FIG. 15 is a flow chartof the operation of this module.

FIG. 16 shows the enclosure belt program module 450. The enclosure beltmodule 450 selects the desired motor profile for driving the motor M1 at452 and receives encoder information for determining motor position fromencoder E1 at 454. Enclosure sensor S2 at 456 detects the presence orabsence of the enclosure at an appropriate entry point. The moduleoutputs enclosure position information to the Pusher Module 400 asbrought out above.

FIG. 17 illustrates the Sucker bar software program module 500. Thismodule receives user information as indicated from the user 202 as wellas position information from both the pusher module 400 and the inserttiming belt module 204. The signal from the skew detector module 302provides a trigger for initializing the operation of the sucker barassembly 70. Module 500 drives motor M5 at 502 using selected profilesand receives position feedback information from encoder E5 at 504. Homesensor S10 at 505 detects the home position of the bar assembly. Vacuumsource motor M17 at 506 operates under the control of module 500 whilevacuum pressure sensor S11 at 508 detects the presence of the vacuum.FIG. 18 is a flow chart of the operation of module 500.

FIG. 19 shows the insert timing belt module 204 which controls theinsert belt drive via motor M7 at 702 and receives motor positioninformation from encoder E7 at 704. Module 700 also controls the vacuumsource motor M16 at 706 and receives the sensor information from vacuumsensor S14 illustrated at 708. Envelope position control information isoutput to the main drum module 300, the arming station module 200, thesucker module 500 and the divert module 900.

FIGS. 20 and 21 show the modules 750 and 800 for control of the rightand left horns, respectively. Each module receives information from theuser 202 and control information and signals from the skew detectormodule 302, sucker module 500, and pusher module 400. The right hornmodule 750 provides position information to the left horn module 800.Module 750 provides drive information to the motor M4 at 752 andreceives position information back from encoder E4 at 754. Home sensorS7 at 756 detects the home location of the right horn and S8 shown at758 senses whether the horn is in the envelope. In similar fashion lefthorn module 800 provides drive information to the left horn motor M3 at802 and receives feedback position information from encoder E3 shown at804. Home sensor S5 at 806 detects the home position of the horn and S6at 808 senses if the left horn is in the envelope. FIGS. 22 and 23 arethe respective flow charts for modules 750 and 800 for controlling theoperation of the horns 120.

The exit roller software module shown at 850 in FIG. 24 drives exitroller motor M11 at 852 and receives motor position information fromencoder E11 at 854. Entry sensor S21 at 856 detects the presence of anenvelope in the exit path.

FIG. 25 illustrates the inputs and outputs of the divert module 900. Asignificant advantage of the control in accordance with the invention isthat the envelope may be efficiently diverted if a problem is detected.That is there is no need to drive the envelope in synchronization with aparticular insert so that the envelope may be simply ejected and anothertransported to the receiving position if required. The envelope positionis received from the timing belt module 204. An exception occurrenceinput is received and a divert gate solenoid 902 is actuated. Envelopeentry sensor S22 shown at 904 provides envelope entry control sensingwhile data is provided to increment the count of items diverted.

FIGS. 26a and 26b comprise a timing diagram of the operating sequence ofthe various motors controlled by the software modules which shows in oneplace a typical timing of the sequence of operation in accordance withthe invention. Since it is believed that the diagram is self-explanatoryto those skilled in the art there is no need for detailed explanation ofthe various operating sequences which have been discussed in conjunctionwith the previous figures and therefore these discussions will not bereiterated here.

In accordance with the present invention, the various required motionprofiles are implemented by describing a motion (acceleration,deceleration, constant velocity, and step) using a set of eight (8) two(2)-byte numbers. FIG. 27 illustrates a typical motion profile for anoperation. The basic formula, x=x_(o) +v_(o) t+(1/2)αt² describes thedistance covered at any point of the motion. This principle is used toconvert linear accelerations and velocities into units of encoderposition at any point in time for use by a servo loop.

FIG. 28 illustrates how the motion profile of FIG. 27 can be broken intoservo time in a plurality of segments. For example, the position at timeT=1 msec is simply the area of triangle a. At time T=2 msec, theposition is 2a+b. It will be understood that the term 2a+b is thedistance and is thus related to the expected encoder information at timeT=2 msec. In order to calculate the numbers a and b, the formulas

    v=αt and x=x.sub.o +v.sub.o t+(1/2)αt.sup.2

are used.

For best results, acceleration and time are adjusted by rounding to thenearest millisecond so that since

v=αt, then t_(adj) =v/α and thereupon t_(adj) is rounded to the nearestmillisecond. The constant α is then recomputed by setting α_(adj)=v/t_(adj) so that the velocity v is correctly achieved.

The parameters a and b can now be computed in terms of encoder clicks.While not to be taken to be a limitation, in a typical encoder, thereare for example 1600 encoder clicks per motor revolution and thus,depending on the particular design arrangement, when the motor turns δrevolutions, the mechanism moves one-inch. Using this information,

b=v inches/sec*(0.001 sec)*(1600 clicks/rev)*δrev/inch

As seen by inspection of FIG. 28, b=2a since a is one half the area ofthe rectangle b.

As also seen from FIG. 28, the area covered during every millisecond ofthe acceleration is equal to c, so that in segment three of the profile,the acceleration is the same as in segment one except that there is aninitial velocity. So,

c=v_(o) inches/sec*(0.001 sec)*(1600 clicks/rev)*δrev/inch

The position can now be computed from any acceleration and any startingvelocity. The resultant equation is

E(n)=(n)(a+c)+(n-1)(b)+E(0)

where E(0) is the encoder position at T=0 msec.

In the case of a constant velocity as in segment two, a and b are 0 andE(n)=n(c)+E(0). Decelerations are simply a special case of acceleration,so that as illustrated in FIG. 29a, a deceleration profile segment iscalculated using

E(n)=E(n-1)+(a+c)+(dur-n)b

where dur=duration of deceleration in msecs.

It may also be noted that the acceleration equation may be restated interms of the previous encoder position to define the profile foracceleration calculations shown in the flow chart of 29b

E(n)=E(n-1)+(a+c)+(n-1)b with a,b=0 for constant velocity segments.

Thus the numbers which must be furnished and stored in fields in memory1000 as shown in FIG. 30 for the microprocessor calculation for eachsegment are a, b (at 1002) and c with durations (seen at 1004) added forthe deceleration cases. For best results and in order to avoid the stepof adding a and c, the number a+c (at 1006) may be stored.

A significant advantage accrues in that if motions are desired until adetermined time or an event has occurred as illustrated in FIG. 31, theduration can be set to =-1 and the microprocessor controller willcontinue until a command is received to change the segment. It will alsobe appreciated that if a step is desired, that is to go to position x asfast as possible, the duration is set equal to 1 and a or c is set to bethe distance in encoder clicks with b=0. Thus a or c=step size ininches*δrev/inch*600clicks/rev. With the profile thus described, theservo loop will cause the motor to achieve and hold the position in asshort a time as possible.

Returning now to FIG. 30, if a microprocessor without floating pointcapabilities is used, the numbers (except for duration) may be brokeninto an integer and fractional portion. Also for best results, anotherparameter, Starting B for deceleration segments may be stored at 1010.Starting B=(dur-1)b so that the microprocessor is not required to do anyexpensive multiplications up front. This number also can be broken intointeger and fractional portions.

Preferably, another 2-byte quantity, a flags field 1012 is provided sothat the motion controller can determine the type of segment on which itis operating.

What is claimed is:
 1. A method for providing motion information for a motor controller for a motor having an encoder for providing motor feedback data, the method comprising the steps of:(a) converting a conventional distance formula means into at least one incremental encoder position formula means; (b) determining a set of motion parameters for the encoder position formula means for a plurality of linear segments of a motion profile; (c) storing the set of motion parameters; (d) determining motor drive information using the set of motion parameters and the encoder position formula means for control of the motor during operation of the motor; and (e) driving the motor in accordance with the determined information.
 2. The method of claim 1 wherein the motion is a deceleration and the determination is made in terms of the previous encoder position using the formulaE(n)=E(n-1)+(a+c)+(dur-n)b where a, b, and c are stored motion parameters and dur is duration of deceleration in msecs.
 3. The method of claim 2 wherein dur is set equal to a negative one (-1) to indicate a constant velocity of undetermined length and further comprising the step of driving the motor in accordance with the encoder position formula means and providing an event signal for commanding a change at a determined event.
 4. The method of claim 1 wherein the motion is an acceleration and the determination is made in terms of the previous encoder position using the formulaE(n)=E(n-1)+(a+c)+(n-1)b where a, b, and c are stored motion parameters and wherein a,b=0 for constant velocity segments.
 5. The method of claim 1 further comprising the step of storing a flag for indicating the type of segment being determined.
 6. The method of claim 1 wherein steps a, b and c are performed prior to controlling the motor and steps d and e are performed during control of the motor. 